﻿using System;
using System.Collections;

using GameServer.Virtual_Objects.User;

using GameServer.Managers;

namespace GameServer.Networking.Packets
{
    class PACKET_END_GAME : Packet
    {
        public PACKET_END_GAME(Virtual_Objects.Room.virtualRoom Room)
        {
            //1773469827 30048 1 9 2 29 19 19 29 0 0 7 0 6 3 0 63 178 702 1617554 1-0-4-4-DA//N/!-1100101 1 13 8 0 73 148 329 403221 1-0-2-4-D///N//-1000100 2 7 4 0 39 131 271 1402956 1-0-2-1-DA/////-1100000 3 7 5 0 70 147 486 7236386 1-0-3-6-DA////!-1100001 5 4 10 0 30 89 132 413 1-0-1-3-///O///-0001000 6 7 9 0 104 127 514 1708465 1-0-1-6-//////!-0000001 7 7 9 0 44 96 155 191196 1-0-1-4-////N//-0000100 0 
            //872924827 30048 1 1 1 0 0 0 0 0 0 2 0 16 21 0 80 108 196 1942 0 1-0-0-0-///////-0000000 1 20 18 0 100 121 239 576345 0 1-0-0-0-///////-0000000 0 
            newPacket(30048);
            addBlock(1); // Errorcode
            addBlock(Room.cDerbRounds); // Rounds Won Derberan
            addBlock(Room.cNiuRounds); // Rounds Won NIU
            addBlock(0); // Kills Derberan
            addBlock(0); // Deaths Derberan
            addBlock(0); // Kills Niu
            addBlock(0); // Deaths NIU
            addBlock(0);
            addBlock(0);
            addBlock(Room.Players.Count); // Player count
            foreach (Virtual_Objects.User.virtualUser Player in Room.Players)
            {
                addBlock(Player.RoomSlot); // Slot
                addBlock(Player.rKills); // Kills
                addBlock(Player.rDeaths); // Deaths
                addBlock(Player.rFlags); //Flags
                addBlock(Player.rPoints); // Points
                addBlock(Player.DinarEarned); // Dinar
                addBlock(Player.ExpEarned); // Exp
                addBlock(Player.Exp); // Player Exp
            }
            addBlock(Room.RoomMasterSlot);
        }
    }
}